<template>
  <div class="dashboard-container">
    <!-- 头部内容 -->
    <el-card class="header-card">
      <el-row type="flex" justify="space-between">
        <div class="fl headL">
          <div class="headImg">
            <img src="@/assets/common/图片1.png">
          </div>
          <div class="headInfoTip">
            <p class="firstChild" style="width:450px;margin-left:20px">你好，今天也是元气满满的一天！</p>
            <p class="lastChild" style="margin-left:20px">大鹏一日同风起，扶摇直上九万里</p>
          </div>
        </div>
        <div class="fr">
          <iframe scrolling="no" src="https://tianqiapi.com/api.php?style=ts&skin=orange&city=广州" frameborder="0" width="500" height="220" allowtransparency="true" />
        </div>
      </el-row>
    </el-card>
    <!-- 主要内容 -->
    <el-row type="flex" justify="space-between">
      <!-- 左侧内容 -->
      <el-col :span="13" style="padding-right:26px">
        <!-- 工作日历 -->
        <el-card class="box-card">
          <div slot="header" class="header">
            <span>工作日历</span>
          </div>
          <!-- 放置日历组件 -->
          <workCalendar />
        </el-card>
        <el-col :span="26">
          <el-card class="box-card">
            <div class="header headTit">
              <span>流程申请</span>
            </div>
            <div class="sideNav">
              <el-button class="sideBtn" @click="showFn1">加班申请</el-button>
              <el-button class="sideBtn" @click="showFn2">请假调休</el-button>
              <el-button class="sideBtn" @click="showFn3">离职申请</el-button>
              <el-button class="sideBtn">审批列表</el-button>
              <el-button class="sideBtn">我的信息</el-button>
            </div>
          </el-card>

        </el-col>
      </el-col>
      <!-- 右侧内容 -->
      <el-col :span="13">
        <!-- 公告 -->
        <el-card class="box-card">
          <div class="advContent">
            <div class="title">销售喜讯</div>
            <div class="contentItem">
              <ul class="noticeList">
                <li>
                  <div class="item">
                    <img src="@/assets/common/通知.png" alt="">
                    <div>
                      <p><span class="col">王鹏</span> 发布了 热烈祝贺胡梓源勇创8月销售佳绩</p>
                      <p>2022-09-05 15:21:38</p>
                    </div>
                  </div>
                </li>
                <li>
                  <div class="item">
                    <img src="@/assets/common/通知.png" alt="">
                    <div>
                      <p><span class="col">王鹏</span> 发布了 热烈祝贺温晓桢勇创7月销售佳绩</p>
                      <p>2022-08-03 10:15:03</p>
                    </div>
                  </div>
                </li>
                <li>
                  <div class="item">
                    <img src="@/assets/common/通知.png" alt="">
                    <div>
                      <p><span class="col">王鹏</span> 发布了 热烈祝贺陈诗婷勇创6月销售佳绩</p>
                      <p>2022-07-01 11:45:25</p>
                    </div>
                  </div>
                </li>
                <li>
                  <div class="item">
                    <img src="@/assets/common/通知.png" alt="">
                    <div>
                      <p><span class="col">王鹏</span> 发布了 热烈祝贺赖敏勇创5月销售佳绩</p>
                      <p>2022-06-02 09:28:35</p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </el-card>
        <!-- 绩效指数 -->
        <el-card class="box-card">
          <div slot="header" class="header">
            <span>近三月房价趋势</span>
          </div>
          <lineChart />
        </el-card>
      </el-col>
    </el-row>
    <el-row class="footer">
      <el-card class="box-card">
        <div class="header headTit">
          <span>帮助链接</span>
        </div>
        <div class="sideLink">
          <el-row>
            <el-col :span="8">
              <a href="#">
                <span class="icon iconGuide" />
                <p>入门指南</p>
              </a>
            </el-col>
            <el-col :span="8">
              <a href="#">
                <span class="icon iconHelp" />
                <p>在线帮助手册</p>
              </a>
            </el-col>
            <el-col :span="8">
              <a href="#">
                <span class="icon iconTechnology" />
                <p>联系技术支持</p>
              </a>
            </el-col>
          </el-row>
        </div>
      </el-card>
    </el-row>
    <el-dialog :visible="show1" width="30%">
      <h2>同意申请，你是最棒的员工！</h2>
      <template #footer>
        <el-button size="small" plain type="primary" @click="closeFn1">收到</el-button>
      </template>
    </el-dialog>
    <el-dialog :visible="show2" width="30%">
      <h2>少壮不努力，老大徒伤悲！</h2>
      <template #footer>
        <el-button size="small" plain type="primary" @click="closeFn2">收到</el-button>
      </template>
    </el-dialog>
    <el-dialog :visible="show3" width="30%">
      <h2>人只有在失去的时候,才真真懂得拥有的价值。我不想你有价值,更不想失去你。</h2>
      <template #footer>
        <el-button size="small" plain type="primary" @click="closeFn3">收到</el-button>
      </template>
    </el-dialog>
  </div>
</template>

<script>
// import { mapGetters } from 'vuex'
import workCalendar from './components/work-calendar.vue'
import lineChart from './components/line-chart.vue'

export default {
  // name: 'Dashboard',
  components: {
    workCalendar,
    lineChart
  },
  data() {
    return {
      show1: false,
      show2: false,
      show3: false
    }
  },
  methods: {
    showFn1() {
      this.show1 = true
    },
    showFn2() {
      this.show2 = true
    },
    showFn3() {
      this.show3 = true
    },
    closeFn1() {
      this.show1 = false
    },
    closeFn2() {
      this.show2 = false
    },
    closeFn3() {
      this.show3 = false
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
  margin: 10px;
  li {
    list-style: none;
  }
  .headImg {
    float: left;
    width: 130px;
    height: 220px;
    background: #fff;
          img {
      width: 100%;
      height: 100%;
    }
  }

  .headInfoTip {
    padding: 25px 0 0;
    margin-left: 120px;
    p {
      padding: 0 0 15px;
      margin: 0;
      &.firstChild {
        font-size: 28px;
        font-weight: 700;
      }
      &.lastChild {
        font-size: 20px;
        color: #7f8c8d;
      }
    }
  }
}

.box-card {
  padding: 5px 10px;
  margin-top: 20px;
  .header {
    span {
      color: #2c3e50;
      font-size: 24px;
    }
    .item {
      color: #97a8be;
      float: right;
      padding: 3px 0;
    }
  }
  .headTit {
    span {
      border-bottom: 4px solid #8a97f8;
      padding-bottom: 10px;
    }
  }
}
.header-card{
  position: relative;
  .header {
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1;
  }
}

.advContent {
  background: #fff;
  border-radius: 5px 5px 0px 0px;
  .title {
    font-size: 24px;
    padding: 8px;
    border-bottom: solid 1px #ccc;
  }
  .contentItem {
    padding: 0 30px;
    min-height: 350px;
    .item {
      display: flex;
      padding:18px 0 10px;
      border-bottom: solid 1px #ccc;
      .col {
        color: #8a97f8;
      }
      img {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        margin-right: 10px;
      }
      p{
        padding: 0 0 8px;
      }
    }
  }
}
.noticeList {
  margin: 0;
  padding: 0;
}
.sideNav,
.sideLink {
  padding: 30px 0 12px;
  .sideBtn {
    padding: 16px 26px;
    font-size:16px;
    margin: 10px 5px;
    // width: 100px;
  }
}
.sideLink {
  text-align: center;
  .icon {
    display: inline-block;
    width: 76px;
    height: 76px;
    background: url('./../../assets/common/icon.png') no-repeat;
  }
  .iconGuide {
    background-position: 0 0;
  }
  .iconHelp {
    background-position: -224px 0;
  }
  .iconTechnology {
    background-position: -460px 0;
  }
}
</style>
